package com.example.zqm.git72.Model;

import com.example.zqm.git72.JavaBean.Photo;
import com.example.zqm.git72.Service.ClubService;
import com.example.zqm.git72.Service.PhotoService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2017/4/26.
 */

public class PhotoModel {
    private Retrofit retrofit;
    public PhotoModel(){

        //联网获取网络上的数据
         retrofit = new Retrofit.Builder()
                .baseUrl("http://172.24.10.175/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();

    }

    public Call getList()
    {
        PhotoService photoService=retrofit.create( PhotoService.class);
        return photoService.getList();
    }
      public  Call getPhotoById(String id)
    {
    PhotoService photoService = retrofit.create(PhotoService.class);
    return photoService.getPhotoById(id);
     }
    public  Call createreply(String shatu_id,String userid,String reply_userid,String reply){
        PhotoService photoService = retrofit.create(PhotoService.class);
        return photoService.createreply(shatu_id,userid,reply_userid,reply);
    }
    public  Call fcreate(String userid,String title){
        PhotoService photoService = retrofit.create(PhotoService.class);
        return photoService.fcreate(userid,title);
    }
}
